package com.mingda.weathermagiccenter.mapper;

import com.mingda.weathermagiccenter.pojo.WsStationData;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
* @author Administrator
* @description 针对表【ws_station_data】的数据库操作Mapper
* @createDate 2025-10-21 11:01:31
* @Entity com.mingda.weathermagiccenter.pojo.WsStationData
*/
@Mapper
public interface WsStationDataMapper extends BaseMapper<WsStationData> {

        @Select({ "<script>",
			"SELECT aa.stationkey, aa.timebase, aa.pres, aa.pres_sea, aa.temp, aa.temp_max, aa.temp_min, aa.humi, aa.humi_min, ",
            "aa.prec, aa.win_10_dir, aa.win_10_vel, aa.win_inst_dir, aa.win_inst_vel, aa.snow, aa.wep_now, aa.month, aa.wep_txt,aa.waterrate,aa.waterrate_out_plant,aa.waterrate_inside_plant, ",
            "bb.lon, bb.lat, bb.alt, bb.stationname, bb.orgid, bb.orgname, bb.remark, bb.stationtype, bb.devicetype, bb.alarmflag ",
            " FROM ws_station_data aa, ws_station bb where aa.stationkey=bb.stationkey",
            " <if test=\"stationtype != null and stationtype != ''\" > and bb.stationtype = #{stationtype} </if>",
            " <if test=\"timebase != null and timebase != ''\" > and aa.timebase = to_timestamp(#{timebase}, 'YYYY-MM-DD HH24:00:00') </if>",
            " <if test=\"orgid != null and orgid != ''\" > and bb.orgid like CONCAT(#{orgid},'%') </if>",
		"</script>" })
	    public List<Map<String, Object>> getWsStationData(String orgid, String stationtype, String timebase);

}




